package com.example.imageexample;

import android.os.Bundle;
import android.support.v4.view.ViewPager;
import android.support.v7.app.AppCompatActivity;

import com.example.imageexample.Util.MainAdapter;
import com.example.imageexample.photodraweeview.MultiTouchViewPager;

import java.util.ArrayList;
import java.util.List;

public class MainActivity extends AppCompatActivity {

    private MultiTouchViewPager viewpager;

    private MainAdapter adapter;
    private List<String> infos = new ArrayList<>();

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        viewpager = (MultiTouchViewPager)findViewById(R.id.viewpager);
        viewpager.addOnPageChangeListener(new ViewPager.OnPageChangeListener() {
            @Override
            public void onPageScrolled(int position, float positionOffset, int positionOffsetPixels) {
            }

            @Override
            public void onPageSelected(int position) {

            }

            @Override
            public void onPageScrollStateChanged(int state) {

            }
        });

        infos.add("http://raw.githubusercontent.com/facebook/fresco/gh-pages/static/fresco-logo.png");
        infos.add("res://mipmap/"+R.mipmap.longimg);
        infos.add("res://drawable/"+R.drawable.gifimg);

        adapter = new MainAdapter(this, infos);
        viewpager.setAdapter(adapter);
        viewpager.setCurrentItem(0);
    }

}
